package com.jcl.recruit.api.resume.controller;

import com.jcl.core.resp.ApiResponse;
import com.jcl.core.web.utils.RequestUtils;
import com.jcl.recruit.resume.service.ResumeAttentionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api")
public class ResumeAttentionController {

    @Autowired
    private ResumeAttentionService resumeAttentionService;

    @RequestMapping("/resume/attention/update")
    public ApiResponse update(@RequestBody Map<String, String> params){

        Integer userId = Integer.parseInt(RequestUtils.getUserId());

        int resumeId = Integer.parseInt(params.get("resumeId"));
        Integer fromType = Integer.parseInt(params.get("fromType"));
        resumeAttentionService.attentionResume(userId, resumeId, fromType);
        return  ApiResponse.success("操作成功！");
    }
}
